#ifndef _TRANSIENT_DECAL_H_
#define _TRANSIENT_DECAL_H_

#include "ui/ui_sprite.h"

namespace backdrop
{

class TransientBackdrop;

class TransientDecal
{
public:
	TransientDecal(TransientBackdrop* pBackdrop);
	virtual ~TransientDecal();

	void				Create(const std::string& Name, const math::Vec2& Pos, const math::Vec2& Dir = math::Vec2());
	bool				HitTest(const math::Vec2& Pos);

	virtual bool		Tick(float dt, bool UpdatePos = true);
	virtual void		Render();

	void				ResetPos()							{ m_Pos = m_StartPos; }
	void				SetPos(const math::Vec2& Pos)		{ m_Pos = m_StartPos = Pos; }
	void				SetDir(const math::Vec2& Dir)		{ m_Dir = Dir; }
	void				SetLayer(int Layer)					{ m_Layer = Layer; }
	void				SetRotate(float Rotate)				{ m_Rotate = Rotate; }
	void				SetCycle(const math::Vec2& Cycle)	{ m_Cycle = Cycle; }
	void				SetIsVisible(bool Visible = true)	{ m_IsVisible = Visible; }

	const math::Vec2&	GetPos()				{ return m_Pos; }
	const math::Vec2&	GetSize()				{ return m_Sprite.m_Size; }
	const math::Vec2&	GetStartPos()			{ return m_StartPos; }
	const math::Vec2&	GetDir()				{ return m_Dir; }
	int					GetLayer() const		{ return m_Layer; }
	float				GetRotate() const		{ return m_Rotate; }
	const math::Vec2&	GetCycle()				{ return m_Cycle; }
	const std::string&	GetName()				{ return m_Name; }
	bool				GetIsVisible() const	{ return m_IsVisible; }

protected:
	ui::UISprite		m_Sprite;
	math::Vec2			m_Pos;
	math::Vec2			m_StartPos;
	math::Vec2			m_Dir;
	int					m_Layer;
	float				m_Rotate; // unused; reserve for future use
	math::Vec2			m_Cycle; // unused; reserve for future use

	TransientBackdrop*	m_pBackdrop;
	std::string			m_Name;

private:
	bool				m_IsVisible;
};

}  // namespace backdrop

#endif // _TRANSIENT_DECAL_H_
